<template>
  <h1>EL-消息提示组件</h1>
  <el-button type="success" @click="f(1)">成功提示</el-button>
  <el-button type="danger" @click="f(2)">失败提示</el-button>
  <el-button type="warning" @click="f(3)">警告提示</el-button>
  <el-button type="primary" @click="f(4)">普通提示</el-button>
  <el-button type="info" @click="f(5)">可关闭提示</el-button>
</template>

<script setup>
import { ElMessage } from 'element-plus'
const f = (type) => {
  switch (type) {
    case 1:
      ElMessage.success('成功提示')
      break
    case 2:
      ElMessage.error('失败提示')
      break
    case 3:
      ElMessage.warning('警告提示')
      break
    case 4:
      ElMessage.info('普通提示')
      break
    case 5:
      ElMessage.success({
        message: '可关闭提示',
        duration: 0,
        showClose: true
      })
  }
}
</script>


<style scoped>

</style>
